<?php
###############   COPYLEFT GPLv3 LICENSE   ###############
##
## JFX Version 0.2.7
## Website Management Software
## www.jfxcms.com
##
## Copyright 2009 GPLv3 - http://www.opensource.org/licenses/gpl-3.0.html
##
## Anthony Gallon
## oi_antz@hotmail.com
##
## Permission is hereby granted to any person having a copy of this software
## to freely use and modify as required so long as the copyright notices
## and branding remain intact.
##
## Full license details available at http://www.jfxcms.com/license
##
###############   COPYLEFT GPLv3 LICENSE   ###############

$VIEW = JFX::registry('JFX_View');

$id = get('block');

$block = new JFX_Block;
$block->loadById($id, '', false, true);

$blockButtons = array();

if($block->pageid != $SETTINGS->get('template_page_id')){
    // able to edit the non-template page details
    $editPageButton = new JFX_Block_Button;
    $editPageButton->moduleName = 'core';
    $editPageButton->moduleMethod = 'editPageDetails';
    $editPageButton->imageUrl = $CONFIG->imageUrl.'/admin/icons/globe.png';
    $editPageButton->title = $this->lang('page_edit_details');
    $editPageButton->alternativeText = $this->lang('page_edit_details');
    $editPageButton->blockId = $id;

    $blockButtons[] = $editPageButton;

}


// get the toolbar buttons for editing pages
$blockButtons = $THEME->getBlockButtons($block->id);

// get a unique variable
$res = new stdClass();
if(strlen($blockButtons)==0){
   $res->content = '';
}else{
   $res->content = '<div class="jfx-block-buttons">'.$blockButtons.'</div>';
}

while(ob_get_level()>0) ob_end_clean();
echo json_encode($res);

exit;










